window.itcast = {};
itcast.transitionEnd = function (dom, callback) {
    if(!dom || typeof dom != "object") return false;
    dom.addEventListener("transitionEnd", function () {
        callback && callback();
    })
    dom.addEventListener("webkitTransitionEnd", function () {
        callback && callback();
    })
}

itcast.tap = function (dom,callback) {
    if(!dom || typeof dom != "object") return false;

    var startTime = 0;
    var isMove = false;
    dom.addEventListener("touchstart", function (e) {
        startTime = Date.now();
    });
    dom.addEventListener("touchmove", function (e) {
        isMove = true;
    });
    dom.addEventListener("touchend", function (e) {
        if((Date.now() - startTime) < 150 && !isMove) {
            callback && callback(e);
        }

        startTime = 0;
        isMove = false;
    });
}